package com.sharkburner.aeris.bean.article;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class RssDateFormat extends XmlAdapter<String, Date>{

	private SimpleDateFormat dateFormat=new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
	
	@Override
	public Date unmarshal(String source) throws Exception {
		return dateFormat.parse(source);
	}

	@Override
	public String marshal(Date date) throws Exception {
		return dateFormat.format(date);
	}

}
